<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.mavenrentcars.service.AccountService"%>
<%@page import="com.mavenrentcars.model.User"%>
<% 
	AccountService acc = (AccountService) request.getAttribute("acc");
    User user = (User) acc.getLoggedInAccount();
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/themes/ui-lightness/jquery-ui-1.8.23.custom.css" type="text/css" rel="stylesheet" />
		
		<link href="css/main.css" type="text/css" rel="stylesheet" />
		
        <script src="js/system/jquery-1.8.0.min.js" type="text/javascript"></script>
		<script src="js/system/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
                
        <script src="js/custom/account_controller.js" type="text/javascript"></script>
		<script src="js/custom/account_model.js" type="text/javascript"></script>
		<script src="js/custom/account_view.js" type="text/javascript"></script>
        
        <script src="js/custom/car_controller.js" type="text/javascript"></script>
		<script src="js/custom/car_model.js" type="text/javascript"></script>
		<script src="js/custom/car_view.js" type="text/javascript"></script>
        
        <script src="js/custom/search_controller.js" type="text/javascript"></script>
		<script src="js/custom/search_view.js" type="text/javascript"></script>
        
        <script src="js/custom/login_controller.js" type="text/javascript"></script>
        <script src="js/custom/order_controller.js" type="text/javascript"></script>

        <title>Cars Rent</title>
    </head>
    
    
    <body>
        <div>
            <table width="100%">
                <tr>
                    <td align="left" width="70%">
                        <h1><a href="catalog_view.htm">Rent a Cars</a></h1>
                    </td>

                    <td align="left" width="30%">
                    <div>
                        <table>
                            <tr>
                                <td>
                                    <div><%=(user != null ? user.getUserName() : "Guest" ) %></div>
                                </td>
                                <td>
                                    <h2> | </h2>
                                </td>
                                <% if (user != null) { %>
                                    <td>	
                                        <h2><a href="logout.htm">Logout</a></h2>
                                    </td>	
                                <% } else { %>
                                    <td>	
                                        <h2><a href="security_error.htm">Login</a></h2>
                                    </td>
                                    <td>
                                        <h2> or </h2>
                                    </td>
                                    <td>	
                                        <h2><a href="account_view.htm">Registration</a></h2>
                                    </td>
                                <% } %>
                            </tr>
                        </table>
                    </div>
                    </td>
                </tr>
            </table>
        </div>
        <div >
            <table width="100%" >
                <tr>
                    <td align="left">
                        <div>
                            <table>
                                <tr>
                                    <td>
                                        <h2><a href="catalog_view.htm">Catalog</a></h2>
                                    </td>
                                    <% if (acc.hasOneRole("renter")) { %>
                                    <td>
                                        <h2> | </h2>
                                    </td>
                                    <td>
                                        <h2><a href="my_orders_list.htm">My Orders</a></h2>
                                    </td>
                                    <% } %>
                                    <% if (acc.hasOneRole("lessor")) { %>
                                    <td>
                                        <h2> | </h2>
                                    </td>
                                    <td>
                                        <h2><a href="my_cars_list.htm">My Cars</a></h2>
                                    </td>
                                    <% } %>
                                    <% if (user != null) { %>
                                    <td>
                                        <h2> | </h2>
                                    </td>
                                    <td>
                                        <h2><a href="account_item.htm">Account</a></h2>
                                    </td>
                                    <% } %>
                                </tr>
                            </table>
                        </div>
                        
                    </td>
                </tr>
            </table>
        </div>